{include file="common/header"}
<div class="content-wrapper">
    {include file="taskcategory/nav_category"/}
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="taskcategory/tabs_category"/}
                    <div class="tab-content">
                        <form method="post" class="form-horizontal form" id="post_form">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    任务分类
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">名称</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" name="title" value="{$item['title']?$item['title']:''}" placeholder="请输入分类名称">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">最少奖励积分</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="number" class="form-control" name="min_give_credit1" placeholder="请输入最小奖励积分" value="{$item['min_give_credit1']?$item['min_give_credit1']:0}">
                                            <span class="help-block">输入0，代表不限制</span>
                                        </div>
                                    </div>
                                  <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">最少票数限制</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="number" class="form-control" name="min_piaoshu" placeholder="请输入最少票数限制" value="{$item['min_piaoshu']?$item['min_piaoshu']:0}">
                                            <span class="help-block">输入0，代表不限制</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">最少奖励金额</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="number" class="form-control" name="min_give_credit2" placeholder="请输入最小奖励金额" value="{$item['min_give_credit2']?$item['min_give_credit2']:0}">
                                            <span class="help-block">输入0，代表不限制</span>
                                        </div>
                                    </div>
                                    {:tpl_upload_image(['name'=>'thumb','title' => '图标','value'=>!empty($item['thumb'])?$item['thumb']:'','placeholder'=>'请上传分类图标','help'=>'建议宽高：60*50'])}
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="number" class="form-control" name="order_by" placeholder="请输入数字，越大排序越靠前" value="{$item['order_by']?$item['order_by']:0}">
                                        </div>
                                    </div>
                                      <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">任务限制</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <label class="radio-inline">
                                                <input type="radio" name="only_level"  value="1">
                                                普通会员及以上
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="only_level"   value="2">
                                                VIP会员及以上
                                            </label>
                                             <label class="radio-inline">
                                                <input type="radio" name="only_level"  value="3">
                                                高级VIP会员及以上
                                            </label>
                                             <label class="radio-inline">
                                                <input type="radio" name="only_level"   value="4">
                                                特级VIP会员及以上
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <label class="radio-inline">
                                                <input type="radio" name="is_display" value="1" {$item['is_display']?'checked':''}>
                                                显示
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="is_display" value="0" {$item['is_display']?'':'checked'}>
                                                隐藏
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-6 col-xs-12 col-sm-offset-2">
                                            <input type="hidden" name="id" value="{$item['id']?$item['id']:0}">
                                            <button type="button" name="submit" class="btn btn-primary">提交</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <script type="text/javascript">
                            $(function () {
                                //提交分类信息
                                $("button[name='submit']").click(function () {
                                    $.post(
                                        window.location.href,
                                        $('#post_form').serialize(),
                                        function (res) {
                                            message(res.message,res.redirect,res.type)
                                        },'json'
                                    );
                                });
                            });
                        </script>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file='common/ufooter'}
